﻿@model PlmTurnoverViewModel
@{
    Layout = null;
    ViewBag.Title = "人员变动申报添加";
}
<script type="text/javascript">
    $(function ()
        {
            getChangeType();
            $("#changetype").change(function () {
                var selectedId = $("#changetype option:selected").val();
                getPosition(selectedId);
                getSection(selectedId);
            });
            $("#section").change(function () {
                var unitId = $("#section option:selected").val();
                getSectionName(unitId);
                getPersonnel(unitId);
            });
        }
        );
    function getChangeType()
    {
        $.getJSON(
            "/PlmTurnover/GetChangeType",
            function (data)
            {
                $.each(data, function (i, item)
                {
                    $("<option></option>").val(item["Scd_ID"]).text(item["Scd_Name"]).appendTo($("#changetype"));
                }
                    )
            }
            )
    }
    function getPosition(selectedId)
    {
        $("#position").empty();
        $.getJSON(
            "/PlmTurnover/GetChangeType?id=" + selectedId + "",
            function (data) {
                $.each(data, function (i, item) {
                    $("<option></option>").val(item["Scd_ID"]).text(item["Scd_Name"]).appendTo($("#position"));

                });
            }
            );
    }
    function getSection(selectedId)
    {
        $("#section").empty();
        $.getJSON(
            "/PlmTurnover/GetSection?id=" + selectedId + "",
            function (data)
            {
                $.each(data, function (i,item) {
                    $("<option></option>").val(item["UNIT_ID"]).text(item["UNIT_CODE"]).appendTo($("#section"));
                    $("#reportunit").val(item["UNIT_NAME"]);
                }
                
                );
            }
            );
    }
    function getSectionName(unitId)
    {
        $("#reportunit").empty();
        $.getJSON(
            "/PlmTurnover/getSectionName?id=" + unitId + "",
            function (data) {
                $.each(data, function (i, item) {
                  $("#reportunit").val(item["UNIT_NAME"]);
                }

                );
            }
            );
    }
    function getPersonnel(unitid)
    {
       
        $("#nowname").empty();
        $("#changename").empty();
        $.getJSON(
            "/PlmTurnover/GetNameBySectionID?sectionname= " + unitid + "",
            function (data) {
                $.each(data, function (i, item) {
                    $("<option></option>").val(item["Pi_ID"]).text(item["Pi_Name"]).appendTo($("#nowname"));
                    $("<option></option>").val(item["Pi_ID"]).text(item["Pi_Name"]).appendTo($("#changename"));
                }

                );
            })
    }
</script>

<h2 class="contentTitle">变动申报</h2>
<form method="post" action="@Url.Action("TurnooverAddData", "PlmTurnover")" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone)">
    <div class="pageContent">
        <div class="pageFormContent sortDrag" layouth="97">            
                    @Html.TextBoxFor(model => model.ThePlmTurnoverInfoInfo.T_UserName, new {@readonly="readonly",Value="操作人",@type="hidden" })               
                    @Html.TextBoxFor(model => model.ThePlmTurnoverInfoInfo.T_UpdateTime, new { Value=DateTime.Now.ToString("yyyy-MM-dd"),@type="hidden",@readonly="readonly"})
               <dl style="display:none">
                <dt style="text-align:right">申报人：</dt>
                <dd>
                @Html.TextBoxFor(model => model.ThePlmTurnoverInfoInfo.T_Applicant, new {@class="required",Value="操作人" })    
                </dd>
            </dl>

            <dl style="display:none">
                <dt style="text-align:right">申报日期：</dt>
                <dd>
                 @Html.TextBoxFor(model => model.ThePlmTurnoverInfoInfo.T_DeclarationDate, new { Value=DateTime.Now.ToString("yyyy-MM-dd")})    
                </dd>
            </dl>
               
            <dl>
                <dt style="text-align:right">职位类型：</dt>
                <dd>
                    <select id="changetype" name="changetype">
                         <option>=请选择=</option>
                      @*  <option value="1">监理人员</option>
                        <option value="2">检测人员</option>*@
                    </select>

                </dd>
            </dl>
            <dl>
                <dt style="text-align:right">变动职位：</dt>
                <dd>
                    <select id="position" name="position">
                        <option>=请选择=</option>
                        @*<option value="0">总监理工程师</option>
                        <option value="1">副总监理工程师</option>
                        <option value="2">工程部主任</option>
                        <option value="3">合同部主任</option>
                        <option value="4">驻地监理工程师</option>
                        <option value="5">副驻地监理工程师</option>
                        <option value="6">试验检测工程师</option>
                        <option value="7">专业监理工程师</option>
                        <option value="8">其他监理人员</option>

                        <option value="9">中心试验室主任</option>
                        <option value="10">中心试验室副主任</option>
                        <option value="11">检测工程师</option>
                        <option value="12">检测员</option>*@
                    </select></dd>
            </dl>
            <dl>
                <dt style="text-align:right">所属标段：</dt>
                <dd>
                    <select id="section" name="section">
                        <option >=请选择=</option>
                        @*<option value="0">YLZJ-1</option>
                        <option value="4">YLZD-1</option>
                        <option value="5">YLZD-2</option>
                        <option value="1">YLZJ-2</option>
                        <option value="6">YLZD-3</option>
                        <option value="7">YLZD-4</option>

                        <option value="2">YLJC-1</option>
                        <option value="3">YLJC-2</option>*@
                    </select></dd>
            </dl>
           
             <dl>
                <dt style="text-align:right">申报单位：</dt>
                <dd>
                    <input class="required" id="reportunit" style="width:180px" />
                  @* @Html.TextBoxFor(model => model.ThePlmTurnoverInfoInfo.T_UnitName, new {@class="required" })*@
                </dd>
            </dl>
         
            <dl>
                <dt style="text-align:right">现职人员姓名：</dt>
                <dd>
                    <select id="nowname" name="nowname">
                        <option >=请选择=</option>
                        </select>
                  @*@Html.TextBoxFor(model => model.ThePlmTurnoverInfoInfo.T_ExistingStaff, new {@class="required" }) *@      
                </dd>
            </dl>
            <dl>
                <dt style="text-align:right">变更人员姓名：</dt>
                <dd>
                    @*<input class="required" id="changename" />*@
                     <select id="changename" name="changename">
                        <option >=请选择=</option>
                        </select>
                @* @Html.TextBoxFor(model => model.ThePlmTurnoverInfoInfo.T_ChangePersonnel, new {@class="required" })    *@ 
                </dd>
            </dl>

            <dl class="nowrap">
                <dt style="text-align:right">变更原因：</dt>
                <dd>
                    @*<textarea name="textarea1" class="required" cols="100" rows="6">张三（驻地监理工程师，注册证号：52001052，资格证书：0138273）因身体不适，特申请变更为：李四（专业监理工程师，注册证号：52001052，资格证书：0138273）</textarea>*@
                    @Html.TextAreaFor(model => model.ThePlmTurnoverInfoInfo.T_Reason, new {@class="required",cols="100", rows="6"})
                </dd>
            </dl>
             <dl>
                <dt style="text-align:right">上传变更人电子签名：</dt>
                <dd>
                    <input name="attachment.id" value="" type="hidden">
                    <input class="readonly" name="attachment.fileName" value="" readonly="readonly" type="text" />
                    <a class="btnAttach" href="demo/database/db_attachmentLookup.html" lookupgroup="attachment" width="560" height="300" title="附件">附件</a>
                </dd>
            </dl>
            <dl class="nowrap">
                <dt style="text-align:right">变更人电子签名：</dt>
                <dd>
                    <img src="../../Content/uploadify/img/moren.png" height="70" />
                </dd>
            </dl>
        </div>

        <div class="formBar">
            <ul>
                <li>
                        <button type="submit" class="btn btn-sm">保存</button>
                    </li>
                <li>
                    <button type="button" class="close btn btn-default btn-sm">取消</button>
                </li>
            </ul>
        </div>

    </div>
</form>

